<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"
    import="java.sql.*"
 %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<form name=f1 action=majVendeur.jsp method="post">
<%
Connection conn=null;
Statement stmt=null;
try{
	Class.forName("com.mysql.jdbc.Driver");
}
catch(ClassNotFoundException e){
	System.out.print("la classe est introuvale");
	e.printStackTrace();
	}
try{
	String url="jdbc:mysql://localhost:3306/base_labrocante";
	String user="root";
	String pw="";
	conn=DriverManager.getConnection(url,user,pw);
	stmt = conn.createStatement();
	String nom=request.getParameter("t1");
	String prenom=request.getParameter("t2");
	String log=(String) session.getAttribute("login");
	int tel=Integer.parseInt(request.getParameter("t3"));
	String email=request.getParameter("t4");
	String dateN=request.getParameter("t5");
	String login=request.getParameter("t6");
	String password=request.getParameter("t7");
	
	String req1="update utilisateur set nom='"+nom+"',prenom='"+prenom+"',tel="+tel+",email='"+email+"',dateNaissance='"+dateN+"',login='"+log+"',password='"+password+"' where login='"+log+"'";	
	stmt.executeUpdate(req1);
	response.sendRedirect("majVendeur.jsp");
%>

<%
}
catch(SQLException e){
e.printStackTrace();
}
%>
</form>
</body>
</html>